home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / mail / mailleds.93 / mailleds / mailleds-0.93 / Makefile < prev    next >
Makefile  |  1996-05-21  |  2KB  |  108 lines

  1. # Makefile for mailleds-0.9-beta
  2. CC = gcc
  3. CFLAGS = -c -O2 
  4. #CFLAGS = -c -O2 -g -Wall 
  5. LDFLAGS = 
  6. LN = ln -sf
  7.  
  8. #LIBS = 
  9. LIBS = -L/usr/X11R6/lib/ -lX11
  10.  
  11. USE_X=yes
  12. #USE_X=no
  13.  
  14. # -DPARALELL_SUPPORT will compile support for leds driven off
  15. #    a bank connected to a port, like the one found in led-stat.txt
  16. #
  17. # -DDEBUG removes the call to fork(), making mailleds easier to debug.
  18. #
  19. #DEFINES = -DDEBUG -DPARALLEL_SUPPORT 
  20.  
  21. DEFINES = -DPARALLEL_SUPPORT 
  22. BASEDIR = /usr/local
  23. MANDIR = $(BASEDIR)/man/man1
  24. BINDIR = $(BASEDIR)/bin
  25. #XBINDIR is just for the xmailleds symlink
  26. XBINDIR = /usr/X11R6/bin
  27.  
  28. INSTALLMAN = install -m 0644 
  29. INSTALLBIN = install -o root -g bin
  30.  
  31. # probably no editing needed below here.
  32.  
  33. DIST        = mailleds
  34. VERMAJ        = 0
  35. VERMIN        = 93
  36. VERSION        = $(VERMAJ).$(VERMIN)
  37.  
  38. ifeq ($(USE_X), yes)
  39.     XDEFS=-DX_SUPPORT
  40. endif
  41.  
  42. OBJS    = xmalloc.o mailleds.o mailfile.o leds.o tty.o pid.o X.o
  43.  
  44. .c.o: 
  45.     $(CC) $(CFLAGS) $(DEFINES) $(XDEFS) $< -DVERSION=\"$(VERSION)\"
  46.  
  47. mailleds: $(OBJS)
  48.     $(CC) $(LDFLAGS) $(OBJS) -o mailleds $(LIBS)
  49.  
  50. all: mailleds
  51.     
  52. clean:
  53.     rm -f *.o mailleds
  54.  
  55. install_man:
  56.     $(INSTALLMAN) mailleds.1 $(MANDIR)
  57.     
  58. install_bin:
  59.     $(INSTALLBIN) -m 4755 mailleds $(BINDIR)
  60. ifeq ($(USE_X), yes)
  61.     $(LN) mailleds $(XBINDIR)/xmailleds
  62. endif
  63.  
  64. install: mailleds install_man install_bin
  65.  
  66. # To let the author make a distribution.
  67. LSMFILE        = $(DIST)-$(VERSION).lsm
  68. DISTDIR        = $(DIST)-$(VERSION)
  69. DISTFILE    = $(DIST)-$(VERSION).tar.gz
  70. DISTFILES    = mailleds.c tty.c leds.c mailfile.c xmalloc.c pid.c \
  71.           mailleds.h port.h config.h led-stat.txt portato.c.diff X.c \
  72.           README $(LSMFILE) COPYING HISTORY $(DIST).1 INSTALL TODO Makefile
  73.  
  74. $(LSMFILE): FORCE
  75.     VER=$(VERSION); \
  76.     DATE=`date "+%d%b%y"|tr '[a-z]' '[A-Z]'`; \
  77.     sed -e "s/VER/$$VER/g;s/DATE/$$DATE/g" $(DIST).lsm.in > $(LSMFILE)
  78.  
  79. FORCE:
  80.  
  81. veryclean: clean
  82.     rm -f $(DIST)-$(VERSION).tar.gz
  83.  
  84. chmod:
  85.     chmod a+r *
  86.  
  87. # Warning: distclean removes the lsm-file, which can not be
  88. # regenerated without the lsm.in-file, which is not part of the package.
  89. distclean: veryclean
  90.     rm -f $(LSMFILE)
  91.  
  92. dist: $(LSMFILE) chmod
  93.     mkdir $(DISTDIR)
  94.     chmod a+rx $(DISTDIR)
  95.     ln $(DISTFILES) $(DISTDIR)
  96.     tar -cvzf $(DISTFILE) $(DISTDIR)
  97.     chmod a+r $(DISTFILE)
  98.     rm -rf $(DISTDIR)
  99.  
  100. X.o: X.c
  101. leds.o: leds.c config.h mailleds.h port.h
  102. mailfile.o: mailfile.c config.h mailleds.h
  103. mailleds.o: mailleds.c config.h mailleds.h
  104. pid.o: pid.c config.h mailleds.h
  105. setled.o: setled.c port.h
  106. tty.o: tty.c config.h mailleds.h
  107. xmalloc.o: xmalloc.c
  108.